package com.epam.necklace.view.menu.mainmenu;

import java.io.IOException;

import org.apache.log4j.Logger;

import com.epam.necklace.logic.activity.GetTransparency;
import com.epam.necklace.view.menu.MenuItem;

public class TransparencySearch extends MenuItem {
	private static final Logger log = Logger.getLogger(TransparencySearch.class);

	public TransparencySearch() {
		super("Stones from a given range of transparency", "6");
	}

	@Override
	public boolean execute() {
		try {
			log.info("Search comand");
			GetTransparency transp = new GetTransparency();
			transp.transparencySearch();
		} catch (ArrayIndexOutOfBoundsException e) {
			log.warn("Incorrect input, try again " + e);
		} catch (NumberFormatException e) {
			log.warn("Input the wrong number, try again " + e);
		} catch (IOException e) {
			log.warn("Input problems, try again " + e);
		}
		return true;
	}

}
